import { Modal } from 'antd'
import '../../static/main.css'
import React, { useState } from 'react'

function PopUp(props) {
  //   const tiaoClick = () => {
  //     console.log(props, 'fkjhjfdjdj')
  //     props.history.push('/Dis')
  //   }
  //   const [ModalVisible, setModalVisible] = useState(true)
//   把组件需要的参数结构出来
  const { blanktitle, blankState, onConfirm, onCancel } = props
  
  const handleOk = () => {
    onConfirm && onConfirm('点击子组件确定传递过来的');
  }
  const handleCancel = () => {
    // setModalVisible(false)
    onCancel && onCancel('点击子组件取消传递过来的');
  }

  return (
    <div className="Fun">
      <Modal
        title={blanktitle}
        visible={blankState}
        onOk={handleOk}
        onCancel={handleCancel}
      >
        <p>中间的内容。。。</p>
        <p>中间的内容。。。</p>
        <p>中间的内容。。。</p>
      </Modal>
    </div>
  )
}

export default PopUp
